<script>
	export default {
		globalData: {
			// global_url: 'http://192.168.3.198:130',
			global_url: 'https://szr.zhim123.com',
			titleBarHeight: 0, //头部导航栏高度
			menuButtonHeight: 0, //胶囊高度
			topBarHeight: 0, //顶部总高度
			temp_audio: {},
			temp_titles: [], //临时文案设置
			temp_coverUrl: '',
			isReload: false,
			cloneType: 0,
			pipList: [], //临时画中画列表
			content: '', //临时文案
			ossVideoCover: '?x-oss-process=video/snapshot,t_1000,f_png,w_720,h_1280,m_fast,ar_auto', //视频封面图
			OssVideoShrink: '?x-oss-process=video/snapshot,t_1000,f_png,w_142,h_252,m_fast,ar_auto', //视频缩略图
			screenWidth: 375,
			screenHeight: 812,
			rpxToPxRatio: 2,
			// shareTitle: '我刚刚在帧流数智人看到很多的数字分身案例，分享给你~',
			// appid: 'wx3ff54e44385c4d7c',

			// 影子工厂
			// oemName: '影子工厂',
			// appid: 'wxe4a607062bb18495',
			// isShowVideo: false,
			// bannerUrl: 'index',
			// btn1: 'btn1_yzgc_oem',
			// btn2: 'btn2_yzgc_oem',
			// btn3: 'btn3_yzgc_oem',
			// btn4: 'btn4_yzgc_oem',
			// shareTitle: '我刚刚在影子工厂看到很多的数字分身案例，分享给你~',
			// isShowYZLogo: true,
			// isShowLQLogo: false,
			// isShowJiaochen: true,
			// jiaochengUrl1: 'yingzipeople',
			// jiaochengUrl2: 'yingziVoice',
			// jiaochengUrl3: 'yingzivideo',
			// shareImg: 'https://oop-zl-szr.oss-cn-hangzhou.aliyuncs.com/static/oem/share_01.jpg',
			// isShowurl: true,
			// url: 'http://aiyinzi.zhim123.com'

			// 云生数智
			// oemName: '云生数智',
			// appid: 'wx00ff004219aa6015',
			// isShowVideo: false,
			// bannerUrl: 'index',
			// btn1: 'btn1_yzgc_oem',
			// btn2: 'btn2_yzgc_oem',
			// btn3: 'btn3_yzgc_oem',
			// btn4: 'btn4_yzgc_oem',
			// shareTitle: '我刚刚在云生数智看到很多的数字分身案例，分享给你~',
			// isShowYZLogo: false,
			// isShowLQLogo: false,
			// isShowJiaochen: true,
			// jiaochengUrl1: 'yingzipeople',
			// jiaochengUrl2: 'yingziVoice',
			// jiaochengUrl3: 'yingzivideo',
			// shareImg: 'https://oop-zl-szr.oss-cn-hangzhou.aliyuncs.com/static/oem/share_01.jpg',
			// isShowurl: false,
			// url: ''

			// 领企数字人
			// oemName: '领企数字人',
			// appid: 'wx4175e233f13cb4db',
			// isShowVideo: true,
			// bannerUrl: 'index',
			// btn1: 'btn1_szr_oem',
			// btn2: 'btn2_szr_oem',
			// btn3: 'btn3_szr_oem',
			// btn4: 'btn4_szr_oem',
			// shareTitle: '我刚刚在领企数字人看到很多的数字分身案例，分享给你~',
			// isShowYZLogo: false,
			// isShowLQLogo: true,
			// isShowJiaochen: true,
			// jiaochengUrl1: 'clonepeople',
			// jiaochengUrl2: 'cloneVoice',
			// jiaochengUrl3: 'createVideo',
			// shareImg: 'https://oop-zl-szr.oss-cn-hangzhou.aliyuncs.com/static/oem/share_01.jpg',
			// isShowurl: true,
			// url: 'https://shuziren.lingqikeji.com.cn',

			// 陈王数智人
			// oemName: '陈王数智人',
			// appid: 'wx49a9e17cdc3eb7fe',
			// isShowVideo: true,
			// bannerUrl: 'index',
			// btn1: 'btn1_szr_oem',
			// btn2: 'btn2_szr_oem',
			// btn3: 'btn3_szr_oem',
			// btn4: 'btn4_szr_oem',
			// shareTitle: '我刚刚在陈王数智人看到很多的数字分身案例，分享给你~',
			// isShowYZLogo: false,
			// isShowLQLogo: false,
			// isShowJiaochen: true,
			// jiaochengUrl1: 'clonepeople',
			// jiaochengUrl2: 'cloneVoice',
			// jiaochengUrl3: 'createVideo',
			// shareImg: 'https://oop-zl-szr.oss-cn-hangzhou.aliyuncs.com/static/oem/share_01.jpg',
			// isShowurl: true,
			// url: 'https://szr.chenwang888.cn',

			// 智华光源数字人
			// oemName: '智华光源数字人',
			// appid: 'wxa42a670dd3058eaf',
			// isShowVideo: true,
			// bannerUrl: 'index',
			// btn1: 'btn1_szr_oem',
			// btn2: 'btn2_szr_oem',
			// btn3: 'btn3_szr_oem',
			// btn4: 'btn4_szr_oem',
			// shareTitle: '我刚刚在智华光源数字人看到很多的数字分身案例，分享给你~',
			// isShowYZLogo: false,
			// isShowLQLogo: false,
			// isShowJiaochen: true,
			// jiaochengUrl1: 'clonepeople',
			// jiaochengUrl2: 'cloneVoice',
			// jiaochengUrl3: 'createVideo',
			// shareImg: 'https://oop-zl-szr.oss-cn-hangzhou.aliyuncs.com/static/oem/share_01.jpg',
			// isShowurl: false,
			// url: '',

			// 创灵
			// oemName: '创灵',
			// appid: 'wxc17d10d5ec7f784d',
			// isShowVideo: true,
			// bannerUrl: 'index',
			// btn1: 'btn1_szr_oem',
			// btn2: 'btn2_szr_oem',
			// btn3: 'btn3_szr_oem',
			// btn4: 'btn4_szr_oem',
			// shareTitle: '我刚刚在创灵看到很多的数字分身案例，分享给你~',
			// isShowYZLogo: false,
			// isShowLQLogo: false,
			// isShowJiaochen: true,
			// jiaochengUrl1: 'clonepeople',
			// jiaochengUrl2: 'cloneVoice',
			// jiaochengUrl3: 'createVideo',
			// shareImg: 'https://oop-zl-szr.oss-cn-hangzhou.aliyuncs.com/static/oem/share_01.jpg',
			// isShowurl: true,
			// url: 'https://cl.digital-spark.cn',

			// oemName: '易掌数智人',
			// appid: 'wx4df3d720af68d990',
			// isShowVideo: true,
			// bannerUrl: 'index',
			// btn1: 'btn1_szr_oem',
			// btn2: 'btn2_szr_oem',
			// btn3: 'btn3_szr_oem',
			// btn4: 'btn4_szr_oem',
			// shareTitle: '我刚刚在易掌数智人看到很多的数字分身案例，分享给你~',
			// isShowYZLogo: false,
			// isShowLQLogo: false,
			// isShowJiaochen: true,
			// jiaochengUrl1: 'clonepeople',
			// jiaochengUrl2: 'cloneVoice',
			// jiaochengUrl3: 'createVideo',
			// shareImg: 'https://oop-zl-szr.oss-cn-hangzhou.aliyuncs.com/static/oem/share_01.jpg',
			// isShowurl: true,
			// url: 'https://ai.aiezyzwl.com'

			// oemName: '易成AI数智人',
			// appid: 'wx5cfd5476294c9c58',
			// isShowVideo: true,
			// bannerUrl: 'index',
			// btn1: 'btn1_szr_oem',
			// btn2: 'btn2_szr_oem',
			// btn3: 'btn3_szr_oem',
			// btn4: 'btn4_szr_oem',
			// shareTitle: '我刚刚在易成AI数智人看到很多的数字分身案例，分享给你~',
			// isShowYZLogo: false,
			// isShowLQLogo: false,
			// isShowJiaochen: true,
			// jiaochengUrl1: 'clonepeople',
			// jiaochengUrl2: 'cloneVoice',
			// jiaochengUrl3: 'createVideo',
			// shareImg: 'https://oop-zl-szr.oss-cn-hangzhou.aliyuncs.com/static/oem/share_01.jpg',
			// isShowurl: true,
			// url: 'https://szr.ycykj.tech',

			// oemName: '商易点AI分身',
			// appid: 'wxe75838779729922a',
			// isShowVideo: true,
			// bannerUrl: 'index',
			// btn1: 'btn1_szr_oem',
			// btn2: 'btn2_szr_oem',
			// btn3: 'btn3_szr_oem',
			// btn4: 'btn4_szr_oem',
			// shareTitle: '我刚刚在商易点AI分身看到很多的数字分身案例，分享给你~',
			// isShowYZLogo: false,
			// isShowLQLogo: false,
			// isShowJiaochen: true,
			// jiaochengUrl1: 'clonepeople',
			// jiaochengUrl2: 'cloneVoice',
			// jiaochengUrl3: 'createVideo',
			// shareImg: 'https://oop-zl-szr.oss-cn-hangzhou.aliyuncs.com/static/oem/share_01.jpg',
			// isShowurl: false,
			// url: ''

			// oemName: '汇智谷数字人',
			// appid: 'wx62817859c8bf34e2',
			// isShowVideo: true,
			// bannerUrl: 'index',
			// btn1: 'btn1_szr_oem',
			// btn2: 'btn2_szr_oem',
			// btn3: 'btn3_szr_oem',
			// btn4: 'btn4_szr_oem',
			// shareTitle: '我刚刚在汇智谷数字人看到很多的数字分身案例， 分享给你~',
			// isShowYZLogo: false,
			// isShowLQLogo: false,
			// isShowJiaochen: true,
			// jiaochengUrl1: 'clonepeople',
			// jiaochengUrl2: 'cloneVoice',
			// jiaochengUrl3: 'createVideo',
			// shareImg: 'https://oop-zl-szr.oss-cn-hangzhou.aliyuncs.com/static/oem/share_01.jpg',
			// isShowurl: true,
			// url: 'https://jz.zqshome.com'

			// oemName: 'Ai威获客数字人',
			// appid: 'wx31ba11299158a770',
			// isShowVideo: true,
			// bannerUrl: 'index_vhk',
			// btn1: 'btn1_szr_oem',
			// btn2: 'btn2_szr_oem',
			// btn3: 'btn3_szr_oem',
			// btn4: 'btn4_szr_oem',
			// shareTitle: '我刚刚在Ai威获客数字人看到很多的数字分身案例， 分享给你~',
			// isShowYZLogo: false,
			// isShowLQLogo: false,
			// isShowJiaochen: true,
			// jiaochengUrl1: 'clonepeople',
			// jiaochengUrl2: 'cloneVoice',
			// jiaochengUrl3: 'createVideo',
			// isShowurl: true,
			// shareImg: 'https://oop-zl-szr.oss-cn-hangzhou.aliyuncs.com/static/oem/share_02.jpg',
			// url: 'https://szr.vhuoke.com'

			// oemName: '集客AI获客',
			// appid: 'wx4bced320265ba3db',
			// isShowVideo: true,
			// bannerUrl: 'index_oem_10',
			// btn1: 'btn1_yzgc_oem',
			// btn2: 'btn2_yzgc_oem',
			// btn3: 'btn3_yzgc_oem',
			// btn4: 'btn4_yzgc_oem',
			// shareTitle: '我刚刚在集客AI获客看到很多的数字分身案例，分享给你~',
			// isShowYZLogo: false,
			// isShowLQLogo: false,
			// isShowJiaochen: true,
			// isShowJkLogo: true,
			// jiaochengUrl1: 'clonepeople',
			// jiaochengUrl2: 'cloneVoice',
			// jiaochengUrl3: 'createVideo',
			// jiaochengUrl3: 'createVideo',
			// shareImg: 'https://oop-zl-szr.oss-cn-hangzhou.aliyuncs.com/static/oem/share_oem_07.jpg',
			// isShowurl: true,
			// url: 'https://szr.123zdeg.com'
		},
		onLaunch: async function() {
			this.globalData.titleBarHeight = uni.getMenuButtonBoundingClientRect().top
			this.globalData.menuButtonHeight = uni.getMenuButtonBoundingClientRect().height
			this.globalData.topBarHeight = uni.getMenuButtonBoundingClientRect().top + uni
				.getMenuButtonBoundingClientRect().height
			this.globalData.screenWidth = uni.getSystemInfoSync().screenWidth
			this.globalData.screenHeight = uni.getSystemInfoSync().screenHeight
			this.globalData.rpxToPxRatio = this.globalData.screenWidth / 750

			//小程序更新
			// #ifdef MP
			const updateManager = uni.getUpdateManager()
			updateManager.onCheckForUpdate(function(res) {
				// 请求完新版本信息的回调
				// console.log(res.hasUpdate);
			})
			updateManager.onUpdateReady(function(res) {
				uni.showModal({
					title: '更新提示',
					content: '新版本已经准备好，是否重启应用？',
					showCancel: false,
					confirmText: '好的',
					success(res) {
						if (res.confirm) {
							// 新的版本已经下载好，调用 applyUpdate 应用新版本并重启
							updateManager.applyUpdate()
						}
					}
				})
			})
			var isNeedLogin = true
			var tokenInfo = uni.getStorageSync('tokenInfo')
			if (tokenInfo) {
				try {
					var checkLoginRes = await this.api.account.checklogin({})
					if (checkLoginRes.code === 0) {
						isNeedLogin = false
					} else {
						// this.$util.msg(wxLoginRes.msg);
					}
				} catch (e) {}
			}

			if (isNeedLogin) {
				try {
					// #ifdef MP-WEIXIN
					var loginRes = await this.$mp_mini.login('weixin')
					console.log(loginRes)
					var wxLoginRes = await this.api.account.wxsmalllogin({
						appId: this.globalData.appid,
						code: loginRes.code
					})
					if (wxLoginRes.code === 0) {
						uni.setStorageSync('tokenInfo', wxLoginRes.data)
					} else {
						this.$util.msg(wxLoginRes.msg)
					}
					// #endif
					// #ifndef MP-WEIXIN

					// #endif
				} catch (e) {
					this.$util.msg(e.message)
				}
			}
			// #endif
			this.$isResolve()
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>
<style lang="scss">
	/*每个页面公共css */
	/* 公共样式 */
	@import 'css/zl_common.scss';
	/* 帧流主题样式 */
	@import 'css/zl_theme.scss';

	::-webkit-scrollbar {
		width: 0 !important;
		height: 0 !important;
		background-color: transparent;
	}
</style>